local skel = fk.CreateSkill {
  name = "efengqi__qingnang",
}

Fk:loadTranslationTable{
  ["efengqi__qingnang"] = "青囊",
  [":efengqi__qingnang"] = "你可以将一张<font color='red'>♥</font>牌当【桃】使用；或将一张<font color='red'>♦</font>牌当【散】使用。",
  ["#efengqi__qingnang"] = "青囊：将<font color='red'>♥</font>牌当【桃】使用；将<font color='red'>♦</font>牌当【散】使用",

  ["$efengqi__qingnang1"] = "救死扶伤，悬壶济世。",
  ["$efengqi__qingnang2"] = "妙手仁心，药到病除。",
}

skel:addEffect("viewas", {
  name = "efengqi__qingnang",
  pattern = "peach,drugs",
  prompt = "#efengqi__qingnang",
  anim_type = "support",
  handly_pile = true,
  card_filter = function (self, player, to_select, selected)
    if #selected > 0 then return false end
    local suit = Fk:getCardById(to_select).suit
    local c
    if suit == Card.Heart then
      c = Fk:cloneCard("peach")
    elseif suit == Card.Diamond then
      c = Fk:cloneCard("drugs")
    else
      return false
    end
    c.skillName = self.name
    if Fk.currentResponsePattern then
      return Exppattern:Parse(Fk.currentResponsePattern):match(c)
    else
      return player:canUse(c) and not player:prohibitUse(c)
    end
  end,
  view_as = function (self, player, cards)
    if #cards ~= 1 then return nil end
    local c = Fk:cloneCard(Fk:getCardById(cards[1]).suit == Card.Heart and "peach" or "drugs")
    c.skillName = self.name
    c:addSubcard(cards[1])
    return c
  end,
})

return skel
